package com.party.core.dao.read.member;

import com.party.common.paging.DataParam;
import com.party.common.paging.Page;
import com.party.core.dao.read.BaseReadDao;
import com.party.core.model.member.MemberMerchantCount;
import com.party.core.model.member.MemberMerchantCountQuery;
import com.party.core.model.member.MemberMerchantCountWithMember;
import com.party.core.model.member.MemberMerchantDetailWithMember;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 合作商数据总统计
 * Created by wei.li.
 *
 * @date 2017/12/11 0011
 * @time 17:59
 */
@Repository
public interface MemberMerchantCountReadDao extends BaseReadDao<MemberMerchantCount> {

    /**
     * 根据会员编号查询
     * @param memberId 会员编号
     * @return 统计数据
     */
    MemberMerchantCount findByMemberId(@Param(value = "memberId") String memberId);

    /**
     * 统计查询
     * @param memberMerchantCountQuery 查询参数
     * @param page 分页参数
     * @return 统计列表
     */
    List<MemberMerchantCountWithMember> queryList(@Param("countQuery") MemberMerchantCountQuery memberMerchantCountQuery,
                                                  @Param("dataParam") DataParam dataParam, Page page);

    /**
     * 统计查询
     * @param memberMerchantCountQuery 查询参数
     * @param page 分页参数
     * @return 统计列表
     */
    List<MemberMerchantCountWithMember> queryListWithChild(@Param("countQuery") MemberMerchantCountQuery memberMerchantCountQuery,
                                                           @Param("dataParam") DataParam dataParam, Page page);

    /**
     * 统计所有的统计信息
     * @return 统计信息
     */
    MemberMerchantCount sum();
}
